﻿
@{
    ViewBag.Title = Resources.WebStringsWeb.WebTitle;
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}

@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <style>
        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }
    </style>
}
<div class="page-content" ng-cloak ng-controller="EmergencyController" ng-init="AddModel={};
     PageName='@Request.CurrentExecutionFilePath.Substring(Request.CurrentExecutionFilePath.LastIndexOf("/") + 1)';
     AddModel.Type=1;
     ">
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
			</path>
		</svg>
            <div class="load-msg" ng-bind="LoadingMsg"></div>
        </div>
    </div>
    <div class="page-heading">
        <h1>添加应急处置</h1>
        <div class="options">
            <div class="btn-toolbar">

            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>主体业务</a></li>
        <li><a>应急管理</a></li>
        <li><a>应急处置</a></li>
        <li class="active"><a>添加应急处置</a></li>
    </ol>

    <div class="container-fluid">
        <div class="row">
            <form class="form-horizontal row-border">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading"><h2>添加应急处置</h2></div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">名称：</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" ng-model="AddModel.Title" ng-init="AddModel.Title=''"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">处置内容：</label>
                                <div class="col-sm-8">
                                    <textarea type="text" ng-model="AddModel.Content" ng-init="AddModel.Content=''" placeholder="处置内容" rows="5" class="form-control"></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">处置结果：</label>
                                <div class="col-sm-8">
                                    <textarea type="text" ng-model="AddModel.Reuslt" ng-init="AddModel.Reuslt=''" placeholder="处置结果" rows="5" class="form-control"></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">总结概要：</label>
                                <div class="col-sm-8">
                                    <textarea type="text" ng-model="AddModel.Field_Extension" ng-init="AddModel.Field_Extension=''" placeholder="总结概要" rows="8" class="form-control"></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">备注：</label>
                                <div class="col-sm-8">
                                    <textarea type="text" ng-model="AddModel.Remark" ng-init="AddModel.Remark=''" placeholder="备注" rows="5" maxlength="1000" class="form-control"></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">上传附件<span class="not-null"></span></label>
                                <div class="col-lg-8">
                                    <input type="file" ngf-select ng-model="doc.Files" name="docfiles" id="docfiles" class="file" initialPreviewAsData="true" data-show-remove="true" data-show-preview="true" showCancel="false" data-show-upload="false" multiple required>
                                </div>
                            </div>
                            <div class="panel-footer">
                                <div class="col-sm-2">
                                </div>
                                <div class="col-sm-2">
                                    <button ng-click="AddHandleForm(AddModel,EmployeeNoList);" class="btn btn-primary">提交</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>

    </div>

    <div class="modal fade" id="CheckOptionModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:1250px;">
            <div class="modal-content" style="min-height: 700px;">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">选择参加员工</h2>
                </div>
                <div class="modal-body" style="min-height: 660px;">
                    <div class="row">
                        <div class="col-lg-6">
                            <div class="panel panel-default">
                                <div class="panel-heading"><h2>待选员工</h2></div>
                                <div class="panel-body" style="height:100%;">
                                    <div class="row">
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" placeholder="检查项模糊搜索" ng-model="SearchModel.EmployeeNo" ng-change="GetEmployeeList(SearchModel.EmployeeNo,EmployeeNoList);" />
                                        </div>
                                    </div>
                                    <div class="row" style="margin-top:20px;">
                                        <div class="col-sm-12">

                                            <table class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                                <thead>
                                                    <tr>
                                                        <th>序号</th>
                                                        <th>工号</th>
                                                        <th>姓名</th>
                                                        <th>部门</th>
                                                        <th>操作</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <tr ng-show="EmployeeList==null|| EmployeeList.length==0">
                                                        <td colspan="5">
                                                            无搜索结果
                                                        </td>
                                                    </tr>
                                                    <tr ng-repeat="y in EmployeeList">
                                                        <td>{{$index+1}}</td>
                                                        <td style="text-align:left;">{{y.EmployeeNo}}</td>
                                                        <td style="text-align:left;">{{y.EmployeeName}}</td>
                                                        <td style="text-align:left;">{{y.DepartmentName}}</td>
                                                        <td><button type="button" class="btn btn-primary" ng-click="SelectEmployee(y);">√</button></td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div class="panel panel-default">
                                <div class="panel-heading"><h2>已选员工</h2></div>
                                <div class="panel-body panel-no-padding">
                                    <table class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                        <thead>
                                            <tr>
                                                <th>序号</th>
                                                <th>工号</th>
                                                <th>姓名</th>
                                                <th>部门</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr ng-show="ChoosenEmployeeList.length==0">
                                                <td colspan="5">
                                                    未选任何
                                                </td>
                                            </tr>
                                            <tr ng-repeat="y in ChoosenEmployeeList">
                                                <td>{{$index+1}}</td>
                                                <td style="text-align:left;">{{y.EmployeeNo}}</td>
                                                <td style="text-align:left;">{{y.EmployeeName}}</td>
                                                <td style="text-align:left;">{{y.DepartmentName}}</td>
                                                <td><button type="button" ng-click="RemoveEmployee(y,SearchModel.EmployeeNo);">×</button></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->


</div>


@section Js{
    <script src="~/Assets/js/pg/Emergency.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/Assets/js/libs/moment.min.js"></script>
    <script src="~/Assets/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/Assets/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/Assets/js/libs/angularjs-datepicker.js"></script>
    <script src="~/Assets/js/libs/fileinput.js"></script>
    <script src="~/Assets/js/libs/zh.js"></script>
    <script>
        $('#docfiles').fileinput({
            language: 'zh'
        });
    </script>
}


